feat(environments): make environment list columns sortable - #3020
Conversation
|
View your CI Pipeline Execution ↗ for commit 87f36b4
💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗ ☁️ Nx Cloud last updated this comment at |
There was a problem hiding this comment.
1 issue found across 2 files
Confidence score: 3/5
- In
libs/domains/environments/feature/src/lib/environments-table/environment-section/environment-section.spec.tsx, the unanchored role query matches both row links and nested environment anchors, so the assertion receives four links and the test fails; restrict the query to the individual environment anchor.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="libs/domains/environments/feature/src/lib/environments-table/environment-section/environment-section.spec.tsx">
<violation number="1" location="libs/domains/environments/feature/src/lib/environments-table/environment-section/environment-section.spec.tsx:171">
P2: This unanchored role query also matches each row’s `role="link"` in addition to its nested environment anchor, so the assertion receives four links and the new test fails. Restrict the accessible name to the individual environment anchors.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
| ) | ||
|
|
||
| const getEnvironmentNames = () => | ||
| screen.getAllByRole('link', { name: /alpha|beta/i }).map((link) => link.textContent) |
There was a problem hiding this comment.
P2: This unanchored role query also matches each row’s role="link" in addition to its nested environment anchor, so the assertion receives four links and the new test fails. Restrict the accessible name to the individual environment anchors.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At libs/domains/environments/feature/src/lib/environments-table/environment-section/environment-section.spec.tsx, line 171:
<comment>This unanchored role query also matches each row’s `role="link"` in addition to its nested environment anchor, so the assertion receives four links and the new test fails. Restrict the accessible name to the individual environment anchors.</comment>
<file context>
@@ -157,6 +157,45 @@ describe('EnvironmentSection', () => {
+ )
+
+ const getEnvironmentNames = () =>
+ screen.getAllByRole('link', { name: /alpha|beta/i }).map((link) => link.textContent)
+
+ expect(getEnvironmentNames()).toEqual(['Alpha', 'Beta'])
</file context>
| screen.getAllByRole('link', { name: /alpha|beta/i }).map((link) => link.textContent) | |
| screen.getAllByRole('link', { name: /^(Alpha|Beta)$/i }).map((link) => link.textContent) |
1b1e094 to
71f741f
Compare
There was a problem hiding this comment.
All reported issues were addressed across 2 files (changes from recent commits).
Requires human review: Auto-approval blocked because this review re-detected 1 unresolved issue already reported by Cubic.
Re-trigger cubic
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## staging #3020 +/- ##
===========================================
+ Coverage 50.84% 51.25% +0.41%
===========================================
Files 1313 1287 -26
Lines 28937 28477 -460
Branches 8637 8653 +16
===========================================
- Hits 14713 14596 -117
+ Misses 11822 11472 -350
- Partials 2402 2409 +7
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Allow sorting the environment list by clicking on column headers, with a click toggling the direction between ascending and descending. Sortable columns: Environment (name), Last operation, Cluster and Last update. This mirrors the sortable behavior already used on the service rows (arrow-down for ascending, arrow-up for descending) and exposes the current sort state via aria-sort for accessibility. Defaults are preserved: ephemeral environments still start sorted by the most recent operation, other sections keep the alphabetical order. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
71f741f to
1852c31
Compare
There was a problem hiding this comment.
All reported issues were addressed across 5 reviewed files. 1 file intentionally excluded from review.
Tip: Review your code locally with the cubic CLI to iterate faster.
Re-trigger cubic
Summary
Issue: Make environment table columns sortable with the same three-state interaction as the service list.
aria-sorton both tables, including the default environment sort, without showing an initial arrow.updated_at.Screenshots / Recordings
Header arrows appear only after a sorting click.
Testing
yarn test,yarn format, andyarn lintPR Checklist